﻿@using Inovout.Descriptor
@model IEnumerable<KuaJing.Orders.Domain.Customer>

<div class="iui-panel">
    <h1>客户查询</h1>
    <div class="row form-inline">
        @using (Html.BeginForm())
        {
            <div class="col-md-10">
                @Html.Query()
            </div>
            <div class="col-md-2">
                @Html.Submit("查询", new { @class = "btn btn-default btn-primary" })
            </div>
        }
    </div>
</div>
<div class="iui-panel iui-panel-table">
    <h1>
        客户列表
        <span class="ico-add">
            @Html.ActionLink("上传客户记录", "Upload", new { ReturnUrl = Request.Url })
        </span>
    </h1>
    <div>
        @Html.Table(() => "没有客户数据" + Html.ActionLink("上传客户记录", "Upload", new { ReturnUrl = Request.Url })).Build(properties =>
   {
       properties.Add(m => m.Name);
       properties.Add(m => m.ShortName);
       properties.Add(m => m.SigningDate);
       properties.Add(m => m.Provider).RenderAs(v => v.ToAlias());
       properties.Add(m => m.Butler).RenderAs(v => v == null ? string.Empty : v.Person.Name);
       properties.Add(m => m.Sales).RenderAs(m => m.Person.Name);
       properties.Extend("操作", v => Html.ActionLink("编辑", "Edit", new { Id = v.Id, ReturnUrl = Request.Url }));
   })
    </div>
</div>
